﻿<div ng-controller="categoryController" class="row">
    <div class="col-md-2">
        &nbsp;
    </div>
    <!--Probando-->
    <!--Categorias: {{name}}-->
    <!--Table-->
    <div class="col-md-7">
        <!--Agregar-->
        <form ng-submit="save()">
            <div class="col-xs-3">
                <input type="text" ng-model="category.name" class="form-control" placeholder="Nombre" required />
            </div>
            <div class="col-xs-3">
                <input type="text" ng-model="category.description" class="form-control" placeholder="Descripcion" required />
            </div>
            <button type="submit" class="btn bg-primary">Guardar</button>
        </form>
        <!--Agregar-->
        <br />
        <!--Lista Tabla-->
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th colspan="3" align="center">
                        LISTADO DE CATEGORIAS
                    </th>
                </tr>
                <tr>
                    <th>NOMBRE</th>
                    <th>DESCRICION</th>
                    <th>OPCIONES</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="d in list | filter:name">
                    <td>
                        {{d.name}}
                    </td>
                    <td>
                        {{d.description}}
                    </td>
                    <td align="center">
                        <a href="" ng-click="getById(d)"><span class="glyphicon glyphicon-pencil"></span></a>
                        <a href="" ng-click="delete(d)"><span class="glyphicon glyphicon-remove"></span></a>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--Lista Tabla-->
    </div>
    <!--Table-->
    <div class="col-md-2">
        &nbsp;
    </div>
</div>